package com.third.clock.manager;

import android.content.Context;
import android.text.TextUtils;

import com.bigkoo.svprogresshud.SVProgressHUD;
import com.third.clock.ui.LoginActivity;

/**
 * Created by Administrator on 2018/8/12 0012.
 */

public class WindowMessageManager {

    private Context mContext;

    private SVProgressHUD mSVProgressHUD;

    private static WindowMessageManager messageManager;

    private WindowMessageManager(){

    }

    public static WindowMessageManager getInstance(){
        if(messageManager==null){
            synchronized (WindowMessageManager.class){
                if(messageManager==null){
                    messageManager=new WindowMessageManager();
                }
            }
        }
        return messageManager;
    }

    public void showInfoWithStatus(Context context,String message){
        mSVProgressHUD=new SVProgressHUD(context);
        if(!TextUtils.isEmpty(message)&&mSVProgressHUD!=null){
            mSVProgressHUD.showInfoWithStatus(message);
        }
    }

    public void showSuccessWithStatus(Context context,String message){
        mSVProgressHUD=new SVProgressHUD(context);
        if(!TextUtils.isEmpty(message)&&mSVProgressHUD!=null){
            mSVProgressHUD.showSuccessWithStatus(message);
        }
    }

    public void dismiss(){
        if(mSVProgressHUD!=null&&mSVProgressHUD.isShowing()){
            mSVProgressHUD.dismiss();
        }
    }

}
